<?php
include 'mysqlconnect.php';
$params = array(
    'hostname' => '127.0.0.1',
    'dbname' => 'level',
    'username' => 'root',
    'password' => ''
);
$connect = new mysqlconnect($params);
$connect->connect();
$images = $connect->fetch('select * from cases where recommand >0 order by recommand');
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="src/css/index.css">
        <script type="text/javascript" src = "src/js/jquery-1.7.1.js"></script>
        <script type="text/javascript" src = "src/js/level-index.js"></script>
    </head>
    <body>
        <div class = "main-content">
            <div class = "container">
                <div class = "background-img">
                    <div class = "for-left-nav"></div>
                    <div class = "left-nav">
                        <div class = "nav-top">
                            <div class = "menu">
                                <a href="javascript:;" href = "index.php">MENU</a>
                            </div>
                            <div class = "logo">
                                <a href="index.php"><img src="res/logo.png"></a>
                            </div>
                        </div>
                        <div class = "nav-bottom">
                            <ul id="nav">
                                <i></i><li id="selected"><a href="aboutLevel.php ">LEVEL</a><p>力洋</p></li>
                                <i></i><li><a href="news.php">NEWS</a><p>新闻</p></li>
                                <i></i><li><a href="service.php">SERVICES</a><p>服务</p></li>
                                <i></i><li><a href="cases.php">CASES</a><p>案例</p></li>
                                <i></i><li><a href="career.php">CAREER</a><p>职业</p></li>
                            </ul>
                            <!-- <div class = "nav">
                                    <span>

                                            <i></i><a class = "level" href="aboutLevel.html">LEVEL<span class = "nav-float-div"></span></a><p>力洋</p>
                                    </span>
                                    <span>
                                            <i></i><a class = "news" href="javascript:;">NEWS<span class = "nav-float-div"></span></a><p>新闻</p>
                                    </span>
                                    <span>
                                            <i></i><a class = "services" href="javascript:;">SERVICES<span class = "nav-float-div"></span></a><p>服务</p>
                                    </span>
                                    <span>
                                            <i></i><a class = "cases" href="javascript:;">CASES<span class = "nav-float-div"></span></a><p>案例</p>
                                    </span>
                                    <span>
                                            <i></i><a class = "career" href="javascript:;">CAREER<span class = "nav-float-div"></span></a><p>职业</p>
                                    </span>
                                    
                            </div> -->
                            <div class = "footer">
                                <div class = "contact">
                                    <a href="aboutLevel.php">CONTACT<i></i></a>
                                </div>
                                <div class = "appendix">
                                    <a href="mailto:info@leveldisplay.com">
                                        <img class = "appendix-img" src="res/appendix.png">
                                    </a>
                                    <a href="http://e.weibo.com/LEVELDISIGN"><img class = "weibo-img" src="res/weibo.png"></a>
                                    <img class = "weixin-img" src="res/weixin.png">
                                    <img  class = "code-for-weixin"src="res/code.jpg" style = "width:200px;height:200px;">
                                    <p>Copyrights Reserved tacheworks Design(China)Ltd.</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class = "float-div">

                        <div class = "project">
                            <a href= "javascript:;">Project</a>
                        </div>
                        <div class = "name">
                            <?php for ($i = 0; $i < count($images); $i++) { ?>
                                <a href= "javascript:;" class = "name<?php echo $i + 1 ?>"><?php echo $images[$i]['name_en'] . ' ' . $images[$i]['name_ch'] ?></a>
                            <?php } ?>
                            <div class = "pager">
                                <a href="javascript:;" style = "display:none;"class = "to-left"><</a>
                                <a href="javascript:;" style = "display:none;" class = "to-right">></a>
                            </div>
                        </div>
                        <div class = "name-info">
                            <?php for ($i = 0; $i < count($images); $i++) { ?>
                                <p class = "name-info<?php echo $i + 1 ?>">
                                    Show / <?php echo $images[$i]['show'] ?><br>
                                    Time / <?php echo $images[$i]['time'] ?><br>
                                    Place / <?php echo $images[$i]['place'] ?><br>
                                    Area / <?php echo $images[$i]['area'] ?>
                                    <?php if ($images[$i]['management']!='') echo '<br/>Management / ' . $images[$i]['management'] ?>
                                    <?php if ($images[$i]['design']!='') echo '<br/>Design / ' . $images[$i]['design'] ?> 
                                    <?php if ($images[$i]['fabrication']!='') echo '<br/>Fabrication / ' . $images[$i]['fabrication'] ?>  

                                </p>
                                <div class = "info-details">

                                <a href="/cases.php?id=<?php echo $images[$i]['id'] ?>"><i></i></a>

                            </div>
                            <?php } ?>
                            
                        </div>

                        <div class = "plus">
                            <a href= "javascript:;">+</a>
                        </div>
                        <div class = "sub-name">
                            <p>Auto China</p>
                        </div>

                    </div>
                    <footer>
                        <div id = "progress-back">
                            <div id = "progress-bar"></div>
                        </div>
                    </footer>
                </div>
            </div>
            <ul id = "surprised">
                <?php
                for ($i = 0; $i < count($images); $i++) {
                    ?>
                    <li class = "slide-0<?php echo $i + 1; ?>">
                        <img src="bg_image/<?php echo $images[$i]['bg_image'] ?>">
                    </li>
                <?php } ?>
            </ul>
        </div>
        <script type="text/javascript" src="src/js/jquery-ui.min.js"></script>
        <script type="text/javascript" src="src/js/jquery.spasticNav.js"></script>	
        <script type="text/javascript">
            $('#nav').spasticNav();
        </script>
    </body>
</html>